<div class="modal fade" id="myModalMessages" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            @foreach (['danger', 'warning', 'success', 'info'] as $msg)
                @if(session()->has($msg))
                    <div class="modal-body alert-{{ $msg }}">
                        <div class="flash-message">
                            {{ session()->get($msg) }}
                        </div>
                    </div>
                    <script>
                        window.onload = function () {
                            $('#myModalMessages').modal({
                                keyboard: true
                            })
                        }
                    </script>
                @endif
            @endforeach
        </div>
    </div>
</div>